package com.czxy.demo07;

import java.util.Random;
import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random rd = new Random();
        int sum = 0;
        while (true){
            System.out.println("1.发牌");
            System.out.println("2.结束发牌");
            System.out.println("请输入需要的功能:");
            int a = sc.nextInt();

            if (a == 1){
                int r = rd.nextInt(14-1)+1;
                sum+=r;
                if (sum<=21){
                    System.out.println("你的手牌是 :"+r+" 手上牌的的点数的累加和是 :"+sum);
                }else {
                    System.out.println("手上牌的的点数的累加和是 :"+sum+" 大于21点,结束游戏");
                    return;
                }

            }else {
                System.out.println("手上牌的的点数的累加和是 :"+sum);
                return;
            }
        }
    }
}
